//Ta Duc Viet
//Sap xep xau ki tu
#include <iostream>
#include <string>
using namespace std;
void string_sort ( char *);
int main(){
	char str[80];
	cout << "Sort string" << endl;
	cout << "Type in a string: ";
	cin.getline ( str, 80);
	string_sort ( str);
	cout << "The sorted string is: " << str << endl;
	system("pause");
	return 0;
}
void string_sort ( char *str){
	char temp;
	for ( int i = 0; str[i] != '\0'; i++){
		for ( int j = 0; str[j + 1] != '\0'; j++){
			if ( str[j] > str[j + 1]){
				temp = str[j + 1];
				str[j + 1] = str[j];
				str[j] = temp;
			}
		}
	}
}
